#include"Sights.h"
#define pictureofsight L"khungcanh.png"
CSights::CSights(int _kind, int _x, int _y)
{
	kind=_kind;
	x=_x;
	y=_y;
	//image=NULL;
	switch(kind)
	{
	case 0:Sight=new CSprite(true,0,0,96,38,0,0,0);break;//doi nho
	case 1:Sight=new CSprite(true,96,0,160,70,0,0,0);break;//doi to
	case 2:Sight=new CSprite(true,0,70,64,48,0,0,0);break;//may nho
	case 3:Sight=new CSprite(true,64,70,128,48,0,0,0);break;//may to
	case 4:Sight=new CSprite(true,0,118,32,92,0,0,0);break;//cay cao
	case 5:Sight=new CSprite(true,33,118,28,60,0,0,0);break;//cay thap
	case 6:Sight=new CSprite(true,0,214,64,32,0,0,0);break;//co
	case 7:Sight=new CSprite(true,64,120,150,150,0,0,0);break;//lau dai
	}
}
CSights::~CSights()
{
	if(Sight!=NULL) delete Sight;
	//if(image!=NULL) image->Release();
}

void CSights::Render(LPD3DXSPRITE sprite,LPDIRECT3DTEXTURE9 image, int time,int xcamara)
{
	if(kind==7) Sight->Render(sprite,image,x-xcamara,y-50);
	else Sight->Render(sprite,image,x-xcamara,y);
}